#ifndef __FEVENT_INTERFACE_H__
#define __FEVENT_INTERFACE_H__

/* Malloc and free fevent */
fevent_ptr fevent_malloc(fevent_config_ptr config);
void fevent_free(fevent_ptr fevent);

/* loop of fevent */
int add_event(fevent_ptr fevent, socket_ptr socket);
int del_event(fevent_ptr fevent, socket_ptr socket);
void fevent_loop(fevent_ptr fevent);

/* Socket Interface */
socket_ptr fevent_socket_malloc();
void fevent_socket_free(socket_ptr socket);

int fevent_create_socket(int port);

/* Callback Function */
/* Accept callback, Return 0 is success, -1 is failed. */
// int do_accept_callback(socket_ptr sock, socket_ptr * client_sock);
/* Read callback, Return received len. */
// int do_read_callback(socket_ptr client_sock, char** buffer, size_t len);
/* End Callback Function */

/* End Socket Interface */

#endif
